<?php
class DomXmlNotExistingNode {
	
	
	public $node;
	public $generatedBy;
	
	public function __construct( DomXmlNode $node, $generatedBy ) {
		$this->node = $node;
		$this->generatedBy = $generatedBy;
	}
	
	public function throwException() {
		throw new RuntimeException( 
			'Node doesn\'t exist. Call failed when called <b>'.$this->generatedBy.'</b> for node <b>'.
			(get_class($this->node) == 'DomXml' ? 'ROOT' : $this->node->name).'</b><br />'
		);
	}
	
	public function __call( $method, $args ) {
		$this->throwException();
	}
	
	public function __get( $var ) {
		$this->throwException();
	}
	
	public function __toString() {
		return 'NOT EXISTING NODE';
	}
	
}
?>